package com.cuijq.ms.template.v2;

import org.apache.ibatis.io.ResolverUtil.Test;
import org.springframework.util.Assert;

/**
 * @author by CuiJQ
 * @Classname TestCase
 * @Description TestCase Description
 * @Date 2021/5/28 20:19
 */
public class TestCase extends Assert implements Test {

  public void runBare() throws Throwable {
    Throwable exception = null;
    setUp();
    try {
      runTest();
    } catch (Throwable running) {
      exception = running;
    } finally {
      try {
        tearDown();
      } catch (Throwable tearingDown) {
        if (exception == null) {
          exception = tearingDown;
        }
      }
    }
    if (exception != null) {
      throw exception;
    }
  }

  private void runTest() {
  }

  /**
   * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed.
   */
  protected void setUp() throws Exception {
  }

  /**
   * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed.
   */
  protected void tearDown() throws Exception {
  }

  @Override
  public boolean matches(Class<?> aClass) {
    return false;
  }
}
